/**
 * @author tianchao
 */
import request from '@/utils/request'
/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'get',
    params: { dictCode }
  })
}
/**
 * 获取企业权限树(异步)也可以用于下拉选择以及企业
 */

/**
 * 获取部门权限树(异步)
 */

export function getOrgTreeSync(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/adminQuery',
    method: 'post',
    data
  })
}
/**
 * 根据搜索条件查询组织树
 * @param {*} query
 */
export function roleListByName(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/getOrgTreeByName',
    method: 'post',
    data
  })
}
/**
 * 根据搜索条件查询部门树
 * @param {*} query
 */
export function searchOrgTreeSync(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/getAdminDeptTreeByName',
    method: 'post',
    data
  })
}
/**
 * 新增/编辑部门信息
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/adminInsert',
    method: 'post',
    data
  })
}
/**
 * 新增/编辑部门信息
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/adminUpdate',
    method: 'post',
    data
  })
}
/**
 * 删除部门信息
 * @param {*} ids
 */
export function del(ids) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/delete',
    method: 'get',
    params: { ids }
  })
}
/**
 * 获取部门信息
 * @param {*} id
 */
export function get(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/adminGet',
    method: 'get',
    params: { id }
  })
}

